﻿using System.Collections;
using System.Collections.Generic;
using System.Linq;
using blackhouse.WebNemo.Data;

namespace blackhouse.WebNemo.Business.Files
{
    public class NemoFiles : IEnumerable<INemoFile>
    {

        #region Fields

        private readonly List<INemoFile> innerList;

        #endregion

        #region Constructors

        public NemoFiles(IDataAccess dataLayer) {
            this.innerList = dataLayer.GetAllFilesInfo().Select(data => new NemoFile(dataLayer, data)).Cast<INemoFile>().ToList();
        }

        #endregion

        #region Methods

        public IEnumerator<INemoFile> GetEnumerator() {
            return this.innerList.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator() {
            return this.innerList.GetEnumerator();
        }

        #endregion

    }
}
